package bai3;

import java.util.Scanner;

public class Project {
	private int id;
	private String name;
	private String startDate;
	private String endDate;
	private String description;
	public Project(){

	}
	public Project(int id, String name, String startDate, String endDate,
			String description) {
		super();
		this.id = id;
		this.name = name;
		this.startDate = startDate;
		this.endDate = endDate;
		this.description = description;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getStartDate() {
		return startDate;
	}
	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	public Project inputProject(){
		Scanner ip=new Scanner(System.in);
		System.out.println("================Them moi Project===================");
		System.out.println("Nhap vao Id:");
		int id=Integer.parseInt(ip.nextLine());
		System.out.println("Nhap vao ten:");
		String name=ip.nextLine();
		while(name.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap ten");
			name=ip.nextLine();
		}
		System.out.println("Nhap vao ngay bat dau:");
		String startDate=ip.nextLine();
		while(startDate.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap ten");
			startDate=ip.nextLine();
		}
		if(!App.isValidDate(startDate)){
			System.out.println("Nhap khong dung dinh dang. Vui long nhap lai!");
			startDate=ip.nextLine();
		}
		System.out.println("Nhap vao ngay ket thuc:");
		String endDate=ip.nextLine();
		while(endDate.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap ten");
			endDate=ip.nextLine();
		}
		if(!App.isValidDate(startDate)){
			System.out.println("Nhap khong dung dinh dang. Vui long nhap lai!");
			endDate=ip.nextLine();
		}
		System.out.println("Nhap vao mo ta ");
		String description=ip.nextLine();
		while(description.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap ten");
			description=ip.nextLine();
		}
		Project pj=new Project(id,name,startDate,endDate,description);
		return pj;
	}
	public void display(Project pj){
		System.out.println("Id: "+pj.id);
		System.out.println("Name: " +pj.name);
		System.out.println("Ngay bat dau: "+pj.startDate);
		System.out.println("Ngay ket thuc: "+pj.endDate);
		System.out.println("Mo ta: "+pj.description);
	}
}
